<template>
  <div class="data_management">
    <List
      :userslist="userslist"
      :titlearr="titlearr"
      :getuserslist="getuserslist"
      :userscount="userscount"
      :title="title"
    ></List>
  </div>
</template>
<script>
import { getusersall, getallusers } from '@/api/list';

import List from '../components/List.vue';
export default {
  components: {
    List,
  },
  data() {
    return {
      title:'用户列表',
      userslist: [],
      userscount: 1,
      titlearr: ['#', '注册日期', '用户姓名', '注册地址'],
    };
  },
  methods: {
    async getuserslist(sss) {
      const res = await getusersall((sss-1)*10, 10);
      this.userslist = res.data;
    },
    async getuserscount() {
      const res = await getallusers();
      this.userscount = res.data.count;
      console.log(this.userscount);
    },
  },
  created() {
    this.getuserslist(1);
    this.getuserscount();
  },
};
</script>
<style lang="scss" scoped>
.data_management {
  width: 100%;
}
</style>
